package com.system.ad.index.adplan;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;

import java.util.Date;


@Data
@NoArgsConstructor
@AllArgsConstructor
public class AdPlanVo {

    private Long planId;

    /**
     * 标记当前记录所属用户
     */
    @NonNull
    private Long userId;

    /**
     * 推广计划状态
     */
    @NonNull
    private Integer planStatus;

    /**
     * 推广计划开始时间；
     */
    private Date startDate;

    /**
     * 推广计划结束时间；
     */
    private Date endDate;


    public void update(AdPlanVo adPlanVo) {
        if (adPlanVo.getPlanId() != null) {
            this.planId = adPlanVo.planId;
        }
        if (adPlanVo.getUserId() != null) {
            this.userId = adPlanVo.userId;
        }
        if (adPlanVo.getPlanStatus() != null) {
            this.planStatus = adPlanVo.planStatus;
        }
        if (adPlanVo.getStartDate() != null) {
            this.startDate = adPlanVo.startDate;
        }
        if (adPlanVo.getEndDate() != null) {
            this.endDate = adPlanVo.endDate;
        }
    }
}
